<template>
    <div class="medicalEquipment-planProduction-box" v-bind:scrollTop="scrollTop" v-on:scroll="scrollHader">
        <div id="backToTopId"></div>
        <div style="width: 100%;" v-if="this.reportErrors">
            <span style="font-weight: 600;">{{ this.reportErrors }}</span>
        </div>
        <a-form layout="inline" style="display: flex;justify-content: center;padding-top: 20px; font-size: 25px !important; font-weight:600 !important;">
            <a-form-item label="审查模式">
                <!-- {{ options }} -->
                <compSelector
                    :key="selectModelkey"
                    v-model="formField.fscms" 
                    :defaultValue="formField.fscms"
                    :compType="typeRadio"
                    :options="options"
                    @selectHandleChange="selectHandleChange"/>
            </a-form-item>
        </a-form>
        
        <a-tabs v-model:activeKey="modeValue" @change="modevChange">
            
            <!--  ============-->
            <a-tab-pane v-if="formField.fscms=='书面审查意见' || formField.fscms=='技术审评+书面审查意见' && formField.fspfazt == '否' " key="书面审查意见" tab="书面审查意见">
                <planProductionModelTechnicalReview
                 ref="technicalReviewRef"
                 :flowPathParameter="flowPathParameter" 
                 :key="technicalReviewKey" 
                 v-if="flowPathParameter" 
                 @flowPathTwoSuccess="flowPathTwoSuccess" 
                />
            </a-tab-pane>
            <a-tab-pane v-if="formField.fscms=='技术审评' || formField.fscms=='技术审评+书面审查意见' && formField.fcyfazt == '否' " key="技术审评" tab="技术审评">
                <a-form
                    layout="inline"
                    ref="form"
                    :form="form"
                    class="head-form-box">
                    <a-form-item label="审评时间">
                        <a-range-picker @change="timeArrChange($event,0,'技术审评')"
                            v-decorator="['timeArr',{ initialValue:formField.timeArr, rules: rules.timeArr}]"
                        />
                    </a-form-item>
                    <a-form-item label="回避区域">
                        <compSelector
                            :key="compSelectorkey"
                            v-model="formField.fcyhbqy" 
                            :defaultValue="formField.fcyhbqy"
                            :compType="typeCheckbox"
                            dictionaryType="观察员所属地市"
                            @selectHandleChange="selectHandleChangeOny('技术审评')"
                        />
                    </a-form-item>
                    <a-form-item label="选择区域">
                        <vxe-radio-group @change="selectHandleChangeOny('技术审评')" v-model="formField.fcyxzqy" :strict="false">
                            <vxe-radio v-for="(item,index) in vxeOptionsArr" :key="index" :label="item.itemValue" :content="item.itemText"></vxe-radio>
                        </vxe-radio-group>
                    </a-form-item>
                    
                    <!-- <a-form-item label="专业特长">
                        <compSelector
                            :key="compSelectorkey"
                            v-model="formField.fcyzytc" 
                            :defaultValue="formField.fcyzytc"
                            :compType="typeCheckbox"
                            dictionaryType="药品生产专业特长"
                            :separateAreas="'zytc'+blobType.fywflcodeArr[blobType.menuType.indexOf(routeName.substr(routeName.indexOf('__'),routeName.indexOf('_a')+1))]"
                            @selectHandleChange="selectHandleChangeOny('技术审评')"
                        />
                    </a-form-item> -->
                    <a-form-item>
                        <a-form layout="inline">
                            <a-form-item label="审查组长人数">
                                <a-input-number v-model:value="numberOfPeopleData.fzzrs" :min="0" :precision="0" />
                            </a-form-item>
                            <a-form-item label="审查组员人数">
                                <a-input-number v-model:value="numberOfPeopleData.fzyrs" :min="0" :precision="0" />
                            </a-form-item>
                            <a-form-item label="预备审评员人数">
                                <a-input-number v-model:value="numberOfPeopleData.fybrs" :min="0" :precision="0" />
                            </a-form-item>
                            <a-form-item>
                                <a-button class="blue-btn" type="primary" 
                                @click="automaticClick([{fzzrs:numberOfPeopleData.fzzrs,fusertype:'审评员',fssk:'组长',num:numberOfPeopleData.fzzrs},
                                {fzyrs:numberOfPeopleData.fzyrs,fusertype:'审评员',fssk:'组员',num:numberOfPeopleData.fzyrs},
                                {fybrs:numberOfPeopleData.fybrs,fusertype:'审评员',fssk:'预备审评员',num:numberOfPeopleData.fybrs}],0)">自动获取</a-button>
                            </a-form-item>
                        </a-form>
                    </a-form-item>
                </a-form>
                <a-collapse v-model:activeKey="activeKeyArr" class="tabs-collapse-box">
                    <a-collapse-panel key="1" header="审查组长选派">
                        <commpVxeTable
                            :key="refreshTable"
                            ref="headmanVxeTable"
                            :config="dataTableConfig" 
                            :columns="columnsVxe" 
                            :formItem="[]"
                            :adaptiveHeight="true"
                            @updatedChange="updatedChange"
                        >
                        
                            <template v-slot:isAgree="{row}" data-desc="自定操作栏">
                                <a-form layout="inline" class="search-form" >
                                    <a-form-item class="vxe-table-box-w">
                                        <a-select
                                            ref="select"
                                            v-model:value="row.fsftyxp"
                                            style="width: 90px"
                                            @change="selectAgree($event,row)"
                                            >
                                            <a-select-option value="未确认">未确认</a-select-option>
                                            <a-select-option value="同意">同意</a-select-option>
                                            <a-select-option value="不同意">不同意</a-select-option>
                                        </a-select>
                                    </a-form-item>
                                </a-form>
                            </template> 
                            <template v-slot:disagree="{row}" data-desc="自定操作栏">
                                <div style="width: 100%;height: 48px;" @click="disagreeClick(row)">
                                    <span style="line-height: 48px;">{{ row.fbtyyy }}</span>
                                </div>
                            </template>
                            <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                <a-form layout="inline" class="search-form" >
                                    <a-form-item class="vxe-table-box-w">
                                        <a-button class="red-btn" type="primary" @click="deleteClick(row)" >删除</a-button>
                                    </a-form-item>
                                    <a-form-item >
                                        <a-button class="blue-btn dMould-btn" type="primary" @click="editInspector(row)" >编辑核查员</a-button>
                                    </a-form-item>
                                    <a-form-item >
                                        <a-button class="blue-btn dMould-btn" type="primary" @click="sendMessage(row)" >发送确认短信</a-button>
                                    </a-form-item>
                                </a-form>
                            </template>
                        </commpVxeTable>
                        <a-form layout="inline" style="margin-top:20px">
                            <a-form-item >
                                <a-button class="blue-btn" type="primary" @click="headmanPicking('组长')">手动选择</a-button>
                            </a-form-item>
                            <a-form-item >
                                <a-button class="blue-btn" type="primary" @click="headmanRandom('组长')">随机选择</a-button>
                            </a-form-item>
                        </a-form>
                    </a-collapse-panel>
                    <a-collapse-panel key="2" header="审查组员选派">
                        <commpVxeTable
                            :key="refreshTable"
                            ref="headmanVxeTable"
                            :config="memberConfig" 
                            :columns="columnsVxe" 
                            :formItem="[]"
                            :adaptiveHeight="true"
                        >
                        
                            <template v-slot:isAgree="{row}" data-desc="自定操作栏">
                                <a-form layout="inline" class="search-form" >
                                    <a-form-item class="vxe-table-box-w">
                                        <a-select
                                            ref="select"
                                            v-model:value="row.fsftyxp"
                                            style="width: 90px"
                                            @change="selectAgree($event,row)"
                                            >
                                            <a-select-option value="未确认">未确认</a-select-option>
                                            <a-select-option value="同意">同意</a-select-option>
                                            <a-select-option value="不同意">不同意</a-select-option>
                                        </a-select>
                                    </a-form-item>
                                </a-form>
                            </template> 
                            <template v-slot:disagree="{row}" data-desc="自定操作栏">
                                <div style="width: 100%;height: 48px;" @click="disagreeClick(row)">
                                    <span style="line-height: 48px;">{{ row.fbtyyy }}</span>
                                </div>
                            </template>
                            <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                <a-form layout="inline" class="search-form" >
                                    <a-form-item class="vxe-table-box-w">
                                        <a-button class="red-btn" type="primary" @click="deleteClick(row)" >删除</a-button>
                                    </a-form-item>
                                    <a-form-item >
                                        <a-button class="blue-btn dMould-btn" type="primary" @click="editInspector(row)" >编辑核查员</a-button>
                                    </a-form-item>
                                    <a-form-item >
                                        <a-button class="blue-btn dMould-btn" type="primary" @click="sendMessage(row)" >发送确认短信</a-button>
                                    </a-form-item>
                                </a-form>
                            </template>
                        </commpVxeTable>
                        <a-form layout="inline" style="margin-top:20px">
                            <a-form-item >
                                <a-button class="blue-btn" type="primary" @click="headmanPicking('组员')">手动选择</a-button>
                            </a-form-item>
                            <a-form-item >
                                <a-button class="blue-btn" type="primary" @click="headmanRandom('组员')">随机选择</a-button>
                            </a-form-item>
                        </a-form>
                    </a-collapse-panel>
                    <a-collapse-panel key="3" header="预备审评员">
                        <commpVxeTable
                            :key="refreshTable"
                            ref="headmanVxeTable"
                            :config="reservStaffConfig" 
                            :columns="columnsVxe" 
                            :formItem="[]"
                            :adaptiveHeight="true"
                        >
                        
                            <template v-slot:isAgree="{row}" data-desc="自定操作栏">
                                <a-form layout="inline" class="search-form" >
                                    <a-form-item class="vxe-table-box-w">
                                        <a-select
                                            ref="select"
                                            v-model:value="row.fsftyxp"
                                            style="width: 90px"
                                            @change="selectAgree($event,row)"
                                            >
                                            <a-select-option value="未确认">未确认</a-select-option>
                                            <a-select-option value="同意">同意</a-select-option>
                                            <a-select-option value="不同意">不同意</a-select-option>
                                        </a-select>
                                    </a-form-item>
                                </a-form>
                            </template> 
                            <template v-slot:disagree="{row}" data-desc="自定操作栏">
                                <div style="width: 100%;height: 48px;" @click="disagreeClick(row)">
                                    <span style="line-height: 48px;">{{ row.fbtyyy }}</span>
                                </div>
                            </template>
                            <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                <a-form layout="inline" class="search-form" >
                                    <a-form-item>
                                        <a-button class="red-btn" type="primary" @click="deleteClick(row)" >删除</a-button>
                                    </a-form-item>
                                    <a-form-item >
                                        <a-button class="blue-btn" type="primary" @click="editInspector(row)" >编辑核查员</a-button>
                                    </a-form-item>
                                    <a-form-item >
                                        <a-button class="blue-btn dMould-btn" type="primary" @click="sendMessage(row)" >发送确认短信</a-button>
                                    </a-form-item>
                                </a-form>
                            </template>
                        </commpVxeTable>
                        <a-form layout="inline" style="margin-top:20px">
                            <a-form-item >
                                <a-button class="blue-btn" type="primary" @click="headmanPicking('预备审评员')">手动选择</a-button>
                            </a-form-item>
                            <a-form-item >
                                <a-button class="blue-btn" type="primary" @click="headmanRandom('预备审评员',0)">随机选择</a-button>
                            </a-form-item>
                        </a-form>
                    </a-collapse-panel>
                    <a-collapse-panel key="4" header="制作方案">
                        <a-collapse v-model:activeKey="activeKeyArr" class="collapse-original">
                            <a-collapse-panel key="8" header="报告信息">
                                <a-form layout="inline" style="margin-bottom:20px" class="label-box-w">
                                    <a-form-item label="审评依据" class="segment-long-box" >
                                        <a-textarea 
                                            placeholder="请输入审评依据" 
                                            :rows="4" 
                                            v-model:value="formField.fcyjcyj"
                                        />
                                        <a-button
                                        style="margin-left: 15px;" 
                                        class="blue-btn" 
                                        type="primary" 
                                        @click="getBasicField('查验审评依据','fcyjcyj')">
                                        获取审评依据
                                        </a-button>
                                    </a-form-item>
                                    <a-form-item label="审评范围" class="segment-long-box" >
                                        <a-textarea 
                                            placeholder="请输入审评范围" 
                                            :rows="4" 
                                            v-model:value="formField.fcyjcfw"
                                        />
                                        <a-button
                                        style="margin-left: 15px;" 
                                        class="blue-btn" 
                                        type="primary" 
                                        @click="getBasicField('查验审评范围','fcyjcfw')">
                                        获取审评范围
                                        </a-button>
                                    </a-form-item>
                                    <a-form-item >
                                        <a-button style="margin-left: 130px;" class="blue-btn" type="primary" @click="scenePreserveClick('技术审评')">保存</a-button>
                                    </a-form-item>
                                </a-form>
                            </a-collapse-panel>
                        </a-collapse>
                        <a-form layout="inline" style="margin-bottom:10px">
                            <a-form-item >
                                <a-button class="blue-btn" type="primary" @click="generateRecord('审评方案')">生成记录</a-button>
                            </a-form-item>
                        </a-form>
                        <commpVxeTable
                            :key="refreshTable"
                            ref="headmanVxeTable"
                            :config="producerConfig" 
                            :columns="producercolumns" 
                            :formItem="[]"
                            :adaptiveHeight="true"
                            @checkboxChange="programmeCheckboxChange"
                        > 
                            <template v-slot:fwjccmc_slots="{row}" data-desc="自定操作栏">
                                <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                                <!-- fwjlx -->
                            </template>
                            <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                <a-form layout="inline" >
                                    <a-form-item class="vxe-table-box-w">
                                        <a-button class="blue-btn" type="primary" @click="viewClick(row)" >查看</a-button>
                                    </a-form-item>
                                    <a-form-item>
                                        <a-button class="blue-btn dMould-btn" type="primary" @click="producerMould(row,'审评方案')" >选择模板</a-button>
                                    </a-form-item>
                                    <a-form-item v-if="editMode == '服务端模式'">
                                        <!-- 服务端编辑 -->
                                        <a-button class="blue-btn" type="primary" @click="serverEdit(row)" >编辑</a-button>
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w" v-if="row.fwjlx !== '.pdf' && editMode == '客户端模式'">
                                        <a-button class="blue-btn" type="primary" @click="producerEdit(row)" >编辑</a-button>
                                    </a-form-item>
                                    <a-form-item  v-if="row.fwjlx == '.pdf' && editMode == '客户端模式'">
                                            <a-button class="blue-btn dMould-btn" type="primary" @click="againEdit(row)" >重新编辑</a-button>
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w">
                                        <a-button class="red-btn" type="primary" @click="producerDelete(row)" >删除</a-button>
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w">
                                        <a-upload style="display: inline-block;" :beforeUpload="producerBeforeUpload" action="" @change="producerUpload($event,row)">
                                            <a-button class="blue-btn" type="primary">上传</a-button>
                                        </a-upload>
                                        
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w">
                                        <a-button class="blue-btn" type="primary" @click="producerDownload(row)" >下载</a-button>
                                    </a-form-item>
                                    <!-- <a-form-item class="vxe-table-box-w">
                                        <a-button class="blue-btn" type="primary" @click="producerTransmit(row)" >发送</a-button>
                                    </a-form-item> -->
                                </a-form>
                            </template>
                        </commpVxeTable>
                        
                    </a-collapse-panel>
                    <a-collapse-panel key="5" header="审评员函">
                        <a-form layout="inline" style="margin-bottom:10px">
                            <a-form-item >
                                <a-button class="blue-btn" type="primary" @click="generateRecord('选派现场审查员的函')">生成记录</a-button>
                            </a-form-item>
                        </a-form>
                        <commpVxeTable
                            :key="refreshTable"
                            ref="headmanVxeTable"
                            :config="inspectorConfig" 
                            :columns="inspectorColumns" 
                            :formItem="[]"
                            :adaptiveHeight="true"
                            @checkboxChange="programmeCheckboxChange"
                        > 
                            <template v-slot:fwjccmc_slots="{row}" data-desc="自定操作栏">
                                <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                                <!-- fwjlx -->
                            </template>
                            <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                <a-form layout="inline" >
                                    <a-form-item class="vxe-table-box-w">
                                        <a-button class="blue-btn" type="primary" @click="viewClick(row)" >查看</a-button>
                                    </a-form-item>
                                    <a-form-item>
                                        <a-button class="blue-btn dMould-btn" type="primary" @click="producerMould(row,'选派现场审查员的函')" >选择模板</a-button>
                                    </a-form-item>
                                    <a-form-item v-if="editMode == '服务端模式'">
                                        <!-- 服务端编辑 -->
                                        <a-button class="blue-btn" type="primary" @click="serverEdit(row)" >编辑</a-button>
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w" v-if="row.fwjlx !== '.pdf' && editMode == '客户端模式'">
                                        <a-button class="blue-btn" type="primary" @click="producerEdit(row)" >编辑</a-button>
                                    </a-form-item>
                                    <a-form-item  v-if="row.fwjlx == '.pdf' && editMode == '客户端模式'">
                                            <a-button class="blue-btn dMould-btn" type="primary" @click="againEdit(row)" >重新编辑</a-button>
                                    </a-form-item>
                                    <a-form-item >
                                        <a-button class="blue-btn" type="primary" @click="editInspector(row)" >编辑审评员信息</a-button>
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w">
                                        <a-button class="red-btn" type="primary" @click="producerDelete(row)" >删除</a-button>
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w">
                                        <a-upload style="display: inline-block;" :beforeUpload="producerBeforeUpload" action="" @change="producerUpload($event,row)">
                                            <a-button class="blue-btn" type="primary">上传</a-button>
                                        </a-upload>
                                        
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w">
                                        <a-button class="blue-btn" type="primary" @click="producerDownload(row)" >下载</a-button>
                                    </a-form-item>
                                    <!-- <a-form-item class="vxe-table-box-w">
                                        <a-button class="blue-btn" type="primary" @click="producerTransmit(row)" >发送</a-button>
                                    </a-form-item> -->
                                </a-form>
                            </template>
                        </commpVxeTable>
                    </a-collapse-panel>
                    <a-collapse-panel key="6" header="观察员函">
                        <a-form layout="inline" style="margin-bottom:10px">
                            <a-form-item >
                                <a-button class="blue-btn" type="primary" @click="generateRecord('选派现场观察员的函')">生成记录</a-button>
                            </a-form-item>
                            <a-form-item >
                                <a-button class="blue-btn" type="primary" @click="selectObserver('观察员函')">选择观察员</a-button>
                            </a-form-item>
                        </a-form>
                        <commpVxeTable
                            :key="refreshTable"
                            ref="headmanVxeTable"
                            :config="observerConfig" 
                            :columns="observerColumns" 
                            :formItem="[]"
                            :adaptiveHeight="true"
                            @checkboxChange="programmeCheckboxChange"
                        > 
                            <template v-slot:fwjccmc_slots="{row}" data-desc="自定操作栏">
                                <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                                <!-- fwjlx -->
                            </template>
                            <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                <a-form layout="inline" >
                                    <a-form-item class="vxe-table-box-w">
                                        <a-button class="blue-btn" type="primary" @click="viewClick(row)" >查看</a-button>
                                    </a-form-item>
                                    <a-form-item>
                                        <a-button class="blue-btn dMould-btn" type="primary" @click="producerMould(row,'选派现场观察员的函')" >选择模板</a-button>
                                    </a-form-item>
                                    <a-form-item v-if="editMode == '服务端模式'">
                                        <!-- 服务端编辑 -->
                                        <a-button class="blue-btn" type="primary" @click="serverEdit(row)" >编辑</a-button>
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w" v-if="row.fwjlx !== '.pdf' && editMode == '客户端模式'">
                                        <a-button class="blue-btn" type="primary" @click="producerEdit(row)" >编辑</a-button>
                                    </a-form-item>
                                    <a-form-item  v-if="row.fwjlx == '.pdf' && editMode == '客户端模式'">
                                            <a-button class="blue-btn dMould-btn" type="primary" @click="againEdit(row)" >重新编辑</a-button>
                                    </a-form-item>
                                    <a-form-item >
                                        <a-button class="blue-btn dMould-btn" type="primary" @click="editObserver(row)" >修改观察员信息</a-button>
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w">
                                        <a-button class="red-btn" type="primary" @click="producerDelete(row)" >删除</a-button>
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w">
                                        <a-upload style="display: inline-block;" :beforeUpload="producerBeforeUpload" action="" @change="producerUpload($event,row)">
                                            <a-button class="blue-btn" type="primary">上传</a-button>
                                        </a-upload>
                                        
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w">
                                        <a-button class="blue-btn" type="primary" @click="producerDownload(row)" >下载</a-button>
                                    </a-form-item>
                                    <!-- <a-form-item class="vxe-table-box-w">
                                        <a-button class="blue-btn" type="primary" @click="producerTransmit(row)" >发送</a-button>
                                    </a-form-item> -->
                                </a-form>
                            </template>
                        </commpVxeTable>
                    </a-collapse-panel>
                    <a-collapse-panel key="7" header="企业通知函">
                        <a-form layout="inline" style="margin-bottom:10px">
                            <a-form-item >
                                <a-button class="blue-btn" type="primary" @click="generateRecord('企业单位审评通知')">生成记录</a-button>
                            </a-form-item>
                        </a-form>
                        <commpVxeTable
                            :key="refreshTable"
                            ref="headmanVxeTable"
                            :config="enterpriseConfig" 
                            :columns="enterpriseColumns" 
                            :formItem="[]"
                            :adaptiveHeight="true"
                            @checkboxChange="programmeCheckboxChange"
                        > 
                            <template v-slot:fwjccmc_slots="{row}" data-desc="自定操作栏">
                                <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                                <!-- fwjlx -->
                            </template>
                            <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                <a-form layout="inline" >
                                    
                                    <a-form-item class="vxe-table-box-w">
                                        <a-button class="blue-btn" type="primary" @click="viewClick(row)" >查看</a-button>
                                    </a-form-item>
                                    <a-form-item>
                                        <a-button class="blue-btn dMould-btn" type="primary" @click="producerMould(row,'企业单位审评通知')" >选择模板</a-button>
                                    </a-form-item>
                                    <a-form-item v-if="editMode == '服务端模式'">
                                        <a-button class="blue-btn" type="primary" @click="serverEdit(row)" >编辑</a-button>
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w" v-if="row.fwjlx !== '.pdf' && editMode == '客户端模式'">
                                        <a-button class="blue-btn" type="primary" @click="producerEdit(row)" >编辑</a-button>
                                    </a-form-item>
                                    <a-form-item  v-if="row.fwjlx == '.pdf' && editMode == '客户端模式'">
                                            <a-button class="blue-btn dMould-btn" type="primary" @click="againEdit(row)" >重新编辑</a-button>
                                    </a-form-item>
                                    <a-form-item >
                                        <a-button class="blue-btn dMould-btn" type="primary" @click="editInspector(row,1)" >编辑企业</a-button>
                                    </a-form-item>
                                    <a-form-item >
                                        <a-button class="blue-btn dMould-btn" type="primary" @click="viewEnterprise(row)" >查看企业</a-button>
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w">
                                        <a-button class="red-btn" type="primary" @click="producerDelete(row)" >删除</a-button>
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w">
                                        <a-upload style="display: inline-block;" :beforeUpload="producerBeforeUpload" action="" @change="producerUpload($event,row)">
                                            <a-button class="blue-btn" type="primary">上传</a-button>
                                        </a-upload>
                                        
                                    </a-form-item>
                                    <a-form-item class="vxe-table-box-w">
                                        <a-button class="blue-btn" type="primary" @click="producerDownload(row)" >下载</a-button>
                                    </a-form-item>
                                    <!-- <a-form-item class="vxe-table-box-w">
                                        <a-button class="blue-btn" type="primary" @click="producerTransmit(row)" >发送</a-button>
                                    </a-form-item> -->
                                </a-form>
                            </template>
                        </commpVxeTable>
                    </a-collapse-panel>
                </a-collapse>
                <!-- <div style="display: flex;"> -->
                    <!-- <a-form 
                        style="margin-top: 20px;"
                        ref="form"
                        layout="inline" 
                        :form="fthyjForm" >
                        <a-form-item label="被退回意见" v-if="formField.fblzt == '退回'">
                            {{ formField.fthyj }}
                        </a-form-item>
                        <a-form-item label="退回意见" class="comments-or-reasons-box">
                            <a-textarea placeholder="请输入退回意见" :rows="4" 
                                v-decorator="['fthyjInput',{ initialValue:formField.fthyjInput, rules: rules.fthyjInput}]"/>
                        </a-form-item>
                    </a-form>
                    <a-form 
                        style="margin-top: 20px;"
                        ref="form"
                        layout="inline" 
                        :form="transactForm" >
                        
                        <a-form-item label="选择办理人">
                            <a-select
                                :key="compSelectorkey"
                                :options="HandledByOptions"
                                mode="multiple"
                                placeholder="请选择办理人"
                                style="width: 200px"
                                v-decorator="['dbrid',{ initialValue:formField.dbrid, rules: transactRules.dbrid}]"
                                
                                >
                            </a-select>
                        </a-form-item>
                        <a-form-item label="办理意见" class="comments-or-reasons-box">
                            <a-textarea 
                                @focus="ideaFocusEvent" @blur="ideaBlur" @click="ideaClick('技术审评')" placeholder="请输入办理意见" :rows="4" 
                                v-decorator="['opinion',{ initialValue:formField.opinion, rules: rules.opinion}]"/>
                        </a-form-item>
                        <a-form-item label="下个环节">
                            <span style="padding-right: 30px;">{{formField.nextNode}}</span>短信通知<a-checkbox style="margin-left: 10px;" v-model:checked="formField.smgflag"></a-checkbox>
                        </a-form-item>
                        <a-form-item label="是否短信通知">
                            
                            {{formField.nextNode}}
                            <span ></span>短信通知<a-checkbox style="margin-left: 10px;" v-model:checked="formField.smgflag"></a-checkbox>
                        </a-form-item> 
                        
                    </a-form> -->
                    
                <!-- </div> -->
                <!-- <a-form layout="inline" style="display: flex;justify-content: center;padding-top: 20px;">
                    <a-form-item label="退回环节">
                        <a-select
                        :key="compSelectorkey"
                        :options="flowPathParameter.fthyjOptions"
                        placeholder="请选择退回环节"
                        style="width: 130px"
                        v-model:value="formField.shjid"
                        >
                        </a-select>
                    </a-form-item>
                    <a-form-item >
                        <a-button class="blue-btn" type="primary" @click="forwardClick" >退回</a-button>
                    </a-form-item>
                    <a-form-item >
                        <a-button class="blue-btn" type="primary" @click="sceneSubmitClick('技术审评')" >提交审评审核</a-button>
                    </a-form-item>
                    <a-form-item >
                        <a-button class="blue-btn" type="primary" @click="comprehensiveEvaluation('技术审评')" >提交综合评定</a-button>
                    </a-form-item>
                </a-form> -->
            </a-tab-pane>
        </a-tabs>
        <!-- 审核组长手动选人 -->
        <!-- <manualSelection ref="manualRef" :parametersData="manualParameter" @manualSuccess="manualSuccess" /> -->
        <!-- 选择模板 -->
        <a-modal
            title="编辑信息"
            :visible="disagreeVisible"
            :confirm-loading="disagreeLoading"
            @ok="disagreeHandleOk"
            @cancel="disagreeVisible = false"
        >
            <a-form layout="inline">
                <a-form-item label="电话" class="form-item-len">
                    <a-input
                        placeholder="请输入电话"
                        v-model:value="messageForm.fphone"
                    />
                </a-form-item>
                <a-form-item label="邮箱" class="form-item-len">
                    <a-input
                        placeholder="请输入邮箱"
                        v-model:value="messageForm.femail"
                    />
                </a-form-item>
            </a-form>
            
        </a-modal>
        <a-modal
            title="意见"
            v-model:visible="ideaVisible"
            @ok="ideaHandleOk"
            class="idea-modal-box"
            @cancel="ideaVisible = false"
        >
            <a-form layout="inline">
                <a-form-item :label="ideaType" class="pull-input-w">
                    <div style="display: flex;align-items: center;">
                        <vxe-textarea
                         rows="3" 
                         @focus="recordCommentsFocus" 
                         @blur="recordCommentsBlur" 
                         @change="recordCommentsChange"  
                         v-model="opinionsText" 
                         placeholder="请输入或选择意见" 
                         suffix-icon="vxe-icon-search"></vxe-textarea>
                        <a-button style="margin-left: 15px;" class="blue-btn"  type="primary" @click.stop="saveComments" >保存</a-button>
                    </div>
                    <!-- <vxe-input @focus="recordCommentsFocus" @blur="recordCommentsBlur" @change="recordCommentsChange"  v-model:value="opinionsText" placeholder="请输入或选择办理意见" suffix-icon="vxe-icon-search"></vxe-input> -->
                    <div class="opinion-record-box" v-show="isRecordComments">
                        <div v-if="opinionsList.length" class="content-box">
                            <div v-for="(item,index) in opinionsList" class="content-for">
                                <div @click.stop="selectIdea(item)"  class="content-item">
                                    <span class="content-text">{{ item.fcontent }}</span>
                                    <a-button class="red-btn" size="small" type="primary" @click.stop="deleteIdea(item)" >删除</a-button>
                                </div>
                            </div>
                        </div>
                        <div class="no-data-box" v-else>暂无记录！</div>
                    </div>
                </a-form-item>
            </a-form>
        </a-modal>
        <a-modal
            :width="1000"
            title="选择人员"
            :visible="manualVisible"
            @ok="manualHandleOk"
            @cancel="manualVisible = false"
            :forceRender="true"
        >
            <div v-if="selectPersonnel">
                <commpVxeTable
                    :key="manualKey"
                    :config="manualdataTableConfig" 
                    :columns="manualcolumnsVxe" 
                    :formItem="manualformItem"
                    @checkboxChange="checkboxChange"
                    ref="acceptanceRegistrationRef"
                >
                </commpVxeTable>
            </div>
            <div v-else>
                <commpVxeTable
                    :key="modalObserverKey"
                    :config="modalObserverConfig" 
                    :columns="modalObservercolumnsVxe" 
                    :formItem="modalObserverformItem"
                    @radioChange="modalObserverRadioChange"
                    ref="observerRef"
                >
                </commpVxeTable>
            </div>
            
        </a-modal>
        <a-modal
            :width="1000"
            title="选择模板"
            :visible="selectTemplateVisible"
            @ok="selectTemplateHandleOk"
            @cancel="selectTemplateVisible = false"
            :forceRender="true"
        >
            <commpVxeTable
                :key="selectTemplateKey"
                :config="selectTemplateConfig" 
                :columns="selectTemplatecolumnsVxe" 
                :formItem="selectTemplateformItem"
                @radioChange="selectTemplateChange"
                ref="acceptanceRegistrationRef"
            >
            </commpVxeTable>
        </a-modal>
        <a-modal
            :width="300"
            title="人数"
            :visible="numberOfPeopleVisible"
            @ok="numberOfPeopleHandleOk"
            @cancel="numberOfPeopleVisible = false"
            :forceRender="true"
        >
            <a-form layout="inline" class="search-form" >
                <a-form-item label="随机选择组长人数" v-if="this.headmanRandomType == '组长'">
                    <a-input-number v-model:value="numberOfPeopleData.fzzrs" :min="0" :precision="0" />
                </a-form-item>
                <a-form-item label="随机选择组员人数" v-if="this.headmanRandomType == '组员'">
                    <a-input-number v-model:value="numberOfPeopleData.fzyrs" :min="0" :precision="0" />
                </a-form-item>
            </a-form>
            
        </a-modal>
        <enterprise-increase ref="refModel" :addEditParameter="addEditParameter"/>
        <serverEditing ref="serverEditingRef" @refreshChange="manualSuccess"/>
        <signatureModel ref="signatureModelRef" />
        <serverEditingView ref="serverEditingViewRef" @refreshChange="$event=>{}"/>
        <selectTemplate ref="selectTemplateRef" @selectTemplateComplete="selectTemplateComplete"/>
        <!-- 置顶，用图标 -->
        <!-- <div style="bottom: 200px;position: fixed;right: 30px;z-index: 99;">
            <div class="ant-back-top-inner">
                <a href="#backToTopId">
                UP
                </a>
            </div>
        </div> -->
    </div>
</template>
<script>
import selectTemplate from '@/components/selectTemplate/selectTemplate.vue'
import serverEditingView from '@/components/comp-model-series/server-editing-view'
import planProductionModelTechnicalReview from './planProductionModel/technicalReview.vue'
import serverEditing from '@/components/comp-model-series/server-editing.vue'
import compSelector from '@/components/compSelector/compSelector.vue'
import signatureModel from '@/components/signature-model/signatureModel.vue'
import {typeInput, typeNumber, typeSelect, typeCheckbox, typeRadio, } from '@/components/compSearchCriteria/ContractType'
import YchConstant from "@/api/YchConstant";
import enterpriseIncrease from './enterprise-increase.vue'
import {saveSqsxFscmsServe,
    xpHcyByAutoServe,
    xpZjByAutoInCommon,
    deleteXpHcyServe,
    initWjjlServe,
    initBzFlow,
    returnSpBzFlow,
    updateXpHcyxxServe,
    selectWjmbServe,
    deletemodelByIdServe,
    uploadPdfFileById,
    getLocalFileByIdServe,
    sendSmsToFileServe,
    queryFirstNodeDbrServe,
    handlingOpinionsListServe,
    addServe,
    editServe,
    addBatchIdeaServe,
    spcyRsGcyQueryByIdServe,
    spcyRsGcyEditServe,
    commonQueryHcyByXpIdServe,
    queryQyxxById,
    commonUpdateHcyJbxxServe,
    getFileTypeServe,
    xpHcyByHandServe,
    deleteBatchIdeaServe,
    ocalityPostAction,
    returnUpperXcjcFlowJob,
    againEditPdfFile,
    queryYwzdYwflContent,
    saveSelectedGcyToSqsx,
    editQyxx,
    sendSmsByXpjlQr

} from './service/index'
import moment from 'moment'
import commpVxeTable from '@/components/commp-vxe-table/commp-vxe-table.vue'
// import manualSelection from './manualSelection.vue'
import assessCheckApi from './service/api'
import blobType from '@/common/blobType'
import { spawn } from 'child_process'
import { ABackTop } from 'ant-design-vue';
export default {
    components:{
        serverEditing,
        compSelector,
        commpVxeTable,
        enterpriseIncrease,
        planProductionModelTechnicalReview,
        signatureModel,
        serverEditingView,
        selectTemplate,
        ABackTop,
        // manualSelection,
    },
    props:{
        flowPathParameter:{
            type:[Array,Object],
            default: () => {},
            required:false
        }
    },
    watch:{
        flowPathParameter:{
            handler (newval, oldVal) {
                if(newval){
                    this.technicalReviewKey = Date.now()
                    //console.log('流程二参数',newval)
                    this.HandledByOptions = []
                    this.formField = JSON.parse(JSON.stringify(newval))
                     this.formField.nextNodeDbrList.forEach(item => {
                            item = {
                                value:item.dbrid,
                                label:item.dbr
                            }
                            let arr = this.HandledByOptions.filter(i=>i.value == item.dbrid)
                            if(!arr.length){
                                this.HandledByOptions.push(item)
                            }
                        });
                    // this.compSelectorkey = Date.now()
                    this.modeValue = newval.fscms=='技术审评'?'书面审查意见':'技术审评'
                    this.formField.nextNode = newval.fscms=='技术审评'?'审评方案审核':'审评方案审核'
                    if(newval.fscms == '技术审评'){
                        this.reportErrors =''
                        this.options = [{
                            value:'技术审评',label:'技术审评'
                        }]
                        this.modeValue = '技术审评'
                        this.formField.fscms = '技术审评'
                        this.formField.nextNode = '审评方案审核'
                        this.selectModelkey = Date.now()
                    }else if(newval.fscms == '技术审评'){
                        this.reportErrors =''
                        this.options = [{
                            value:'书面审查意见',label:'书面审查意见'
                        }]
                        this.modeValue = '书面审查意见'
                        this.formField.nextNode = '审评方案审核'
                        this.formField.fscms = '书面审查意见'
                        this.selectModelkey = Date.now()
                    }else if(newval.fscms == '技术审评+技术审评'){
                        this.reportErrors =''
                        if(newval.fspfazt == '是' && newval.fcyfazt == '否'){
                            this.reportErrors =''
                            this.options = [{
                                value:'技术审评',label:'技术审评'
                            }]
                            this.modeValue = '技术审评'
                            this.formField.fscms = '技术审评'
                            this.formField.nextNode = '审评方案审核'
                            this.selectModelkey = Date.now()
                        }else if(newval.fspfazt == '否' && newval.fcyfazt == '是'){
                            this.options = [{
                                value:'书面审查意见',label:'书面审查意见'
                            }]
                            this.modeValue = '书面审查意见'
                            this.formField.fscms = '书面审查意见'
                            this.formField.nextNode = '审评方案审核'
                            this.selectModelkey = Date.now()
                            
                        }else if(newval.fspfazt == '是' && newval.fcyfazt == '是'){
                            this.reportErrors = '页面出错了，请联系系统管理员'
                        }else if(newval.fspfazt == '否' && newval.fcyfazt == '否'){
                            this.reportErrors =''
                            this.options = [{
                                value:'技术审评',label:'技术审评'
                            },{
                                value:'书面审查意见',label:'书面审查意见'
                            },{
                                value:'技术审评+书面审查意见',label:'技术审评+书面审查意见'
                            }]
                            this.modeValue = '书面审查意见'
                            this.formField.nextNode = '审评方案审核'
                            this.formField.fscms = '技术审评+书面审查意见'
                            this.selectModelkey = Date.now()
                        }
                    }
                    this.$emit('getModeValue',this.modeValue)
                }
            },
            immediate: true,
            deep: true
        },
        modeValue:{
            handler(newval, oldVal){
                this.modevData(newval)
                //console.log('当前审核模式改变了',newval)
                
            },
            immediate: true,
            deep: true
        },
        FieldPdf:{
            handler (newval, oldVal) {
                //console.log('当前啊存的dpf',newval)
                this.refreshTable = Date.now()
            },
            deep:true,
        }
    },
    data(){
        return{
            technicalReviewKey:null,
            headmanRandomNum:{},
            headmanRandomType:'',
            numberOfPeopleVisible:false,
            numberOfPeopleData:{
                fzzrs:0,
                fzyrs:0,
                fybrs:0,
            },
            selectTemplateVisible:false,
            selectTemplateKey:null,
            templateId:'',
            takeNotesId:'',
            takeNotesType:'',
            selectTemplateConfig:{
                api:assessCheckApi.queryYwflWjmbList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                selectType:'radio',
                listData:'wjmbList',
                paramet:{
                    sqsxid:this.flowPathParameter.sqsxid
                }
            },
            selectTemplatecolumnsVxe:[{
                    type:'radio',
                    width:60,
                },{
                    title: '模板标题', //列头显示文字
                    field: 'fmbbt',
                    key: 'fmbbt',
                },{
                    title: '模板类型', //列头显示文字
                    field: 'fmblx1',
                    key: 'fmblx1',
                }],
            selectTemplateformItem:[{
                    label: '模板标题',
                    model: 'fmbbt',
                }],
            blobType:blobType,
            routeName:this.$route.name,
            ideaVisible:false,
            nextNode:'',
            isRecordComments:false,
            opinionsList:[],
            opinionsText:'',
            form: this.$form.createForm(this, { name: 'acceptanceDealWith' }),
            spForm: this.$form.createForm(this, { name: 'acceptanceDealWithSpForm' }),
            transactForm: this.$form.createForm(this, { name: 'transactFormName' }),
            spTransactForm: this.$form.createForm(this, { name: 'spTransactFormName' }),
            fthyjForm: this.$form.createForm(this, { name: 'fthyjForm' }),
            typeRadio:typeRadio,
            typeCheckbox:typeCheckbox,
            options:[],
            selectModelkey:null,
            rules:{
                timeArr: [{
                    type:'array',
                    required: true,
                    message: '请选择审评时间',
                    trigger: 'blur',
                }],
                spTimeArr: [{
                    type:'array',
                    required: true,
                    message: '请选择审评时间',
                    trigger: 'blur',
                }],
                opinion: [{
                    required: true,
                    message: '请输入办理意见',
                    trigger: 'blur',
                }],
                fthyjInput: [{
                    required: true,
                    message: '请输入退回意见',
                    trigger: 'blur',
                }],
            },
            transactRules:{
                dbrid: [{
                    type:'array',
                    required: true,
                    message: '请选择办理人',
                    trigger: 'blur',
                }]
            },
            activeKeyArr:['1','2','3','4','5','6','7','8','9'],
            formField:{
                // fscms:'技术审评',
                // fcykssj:'',//审评开始时间
                // fcyjssj:'',//审评结束时间
                // fcyhbqy:[],//回避区域
                // fcyxzqy:[],//选择区域
                // fcyzytc:'',//专业特长
                // timeArr:[],
            },
            //组长
            dataTableConfig:{
                api:assessCheckApi.queryHcyXpList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'zzXpjlList',
                paramet:{
                    sqsxid:this.flowPathParameter.sqsxid
                }
            },
            columnsVxe:[{
                title: '姓名', //列头显示文字
                field: 'fjcyxm',
                width:80,
            },{
                title: '工作单位', //列头显示文字
                field: 'fgzdw',
                // width:180,
            },{
                title: '所属区域', //列头显示文字
                field: 'fssqy',
                width:80,
            },{
                title: '联系电话', //列头显示文字
                field: 'fjcylxdh',
                width:150,
            },{
                title: '邮箱', //列头显示文字
                field: 'fjcyyx',
                width:150,
            },{
                title: '是否同意', //列头显示文字
                field: 'fsftyxp',
                width:134,
                slots: {
                // 使用插槽模板渲染
                    default: 'isAgree',
                }
            },{
                title: '不同意意见', //列头显示文字
                field: 'fbtyyy',
                width:120,
                slots: {
                // 使用插槽模板渲染
                    default: 'disagree',
                }
            },{
                title: '选择方式', //列头显示文字
                field: 'fxpfs',
                width:100,
            },{
                title: '短信发送状态', //列头显示文字
                field: 'fsmszt',
                width:120,
            }
            // ,{
            //     title: '确认短信发送时间', //列头显示文字
            //     field: 'fxpfs',
            //     width:120,
            // }
            ,{
                title: '操作',
                field: 'id',
                slots: {
                // 使用插槽模板渲染
                default: 'operation_btn',
                },
                width:350,
                fixed:'right'
            }],

            //组员
            memberConfig:{
                api:assessCheckApi.queryHcyXpList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'zyXpjlList',
                paramet:{
                    sqsxid:this.flowPathParameter.sqsxid
                }
            },
            //预备审评员
            reservStaffConfig:{
                api:assessCheckApi.queryHcyXpList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'ybXpjlList',
                paramet:{
                    sqsxid:this.flowPathParameter.sqsxid
                }
            },
            //方案
            producerConfig:{
                api:assessCheckApi.queryHcyXpList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'jcfaList',
                isPdf:true,
                suffix:{
                    key:'fwjlx',
                    value:'.pdf'
                },
                paramet:{
                    sqsxid:this.flowPathParameter.sqsxid
                }
            },
            producercolumns:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                    title: '方案', //列头显示文字
                    field: 'fwjccmc',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'fwjccmc_slots',
                    }
                },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    }
            }],
            inspectorConfig:{
                api:assessCheckApi.queryHcyXpList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'xpxccydhList',
                isPdf:true,
                suffix:{
                    key:'fwjlx',
                    value:'.pdf'
                },
                paramet:{
                    sqsxid:this.flowPathParameter.sqsxid
                }
            },
            inspectorColumns:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                    title: '姓名', //列头显示文字
                    field: 'fbusmc',
                    width:120,
                },{
                    title: '审评员涵', //列头显示文字
                    field: 'fwjccmc',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'fwjccmc_slots',
                    },
                },{
                    title: '短信状态', //列头显示文字
                    field: 'fdxzt',
                    width:120,
                },{
                    title: '盖章状态', //列头显示文字
                    field: 'fgzzt',
                    width:120,
                },{
                    title: '邮箱状态', //列头显示文字
                    field: 'fyxzt',
                    width:120,
                },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:750,
                    fixed:'right'
            }],
            observerConfig:{
                api:assessCheckApi.queryHcyXpList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'xpxcgcydhList',
                isPdf:true,
                suffix:{
                    key:'fwjlx',
                    value:'.pdf'
                },
                paramet:{
                    sqsxid:this.flowPathParameter.sqsxid
                }
            },
            observerColumns:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                    title: '姓名', //列头显示文字
                    field: 'fbusmc',
                    width:120,
                },{
                    title: '观察员函', //列头显示文字
                    field: 'fwjccmc',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'fwjccmc_slots',
                    },
                },{
                    title: '短信状态', //列头显示文字
                    field: 'fdxzt',
                    width:120,
                },{
                    title: '盖章状态', //列头显示文字
                    field: 'fgzzt',
                    width:120,
                },{
                    title: '邮箱状态', //列头显示文字
                    field: 'fyxzt',
                    width:120,
                },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:750,
                    fixed:'right'
            }],
            enterpriseConfig:{
                api:assessCheckApi.queryHcyXpList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                isPdf:true,
                suffix:{
                    key:'fwjlx',
                    value:'.pdf'
                },
                listData:'qydwjctzList',
                paramet:{
                    sqsxid:this.flowPathParameter.sqsxid
                }
            },
            enterpriseColumns:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                    title: '企业名称', //列头显示文字
                    field: 'fbusmc',
                    width:150,
                },{
                    title: '企业通知涵', //列头显示文字
                    field: 'fwjccmc',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'fwjccmc_slots',
                    },
                },{
                    title: '短信状态', //列头显示文字
                    field: 'fdxzt',
                    width:120,
                },{
                    title: '盖章状态', //列头显示文字
                    field: 'fgzzt',
                    width:120,
                },{
                    title: '邮箱状态', //列头显示文字
                    field: 'fyxzt',
                    width:120,
                },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:820,
                    fixed:'right'
            }],
            rectificationConfig:{
                api:assessCheckApi.queryHcyXpList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'jczgclyqList',
                isPdf:true,
                suffix:{
                    key:'fwjlx',
                    value:'.pdf'
                },
                paramet:{
                    sqsxid:this.flowPathParameter?this.flowPathParameter.sqsxid:''
                }
            },
            rectificationColumns:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '整改材料名称', //列头显示文字
                field: 'fwjccmc',
                slots: {
                    // 使用插槽模板渲染
                    default: 'fwjccmc_slots',
                },
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:750,
                fixed:'right'
            }],
            //补正通知
            correctionConfig:{
                api:assessCheckApi.queryHcyXpList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'bztzList',
                paramet:{
                    sqsxid:this.flowPathParameter.sqsxid
                }
            },
            correctionColumns:[{
                    title: '补正通知', //列头显示文字
                    field: 'fwjccmc',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'fwjccmc_slots',
                    },
                },{
                    title: '短信状态', //列头显示文字
                    field: 'fdxzt',
                    width:120,
                },{
                    title: '盖章状态', //列头显示文字
                    field: 'fgzzt',
                    width:120,
                },{
                    title: '邮箱状态', //列头显示文字
                    field: 'fyxzt',
                    width:120,
                },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:750,
                    fixed:'right'
            }],
            compSelectorkey:null,
            modeValue:'书面审查意见',
            manualParameter:{},
            refreshTable:null,
            disagreeObject:{},
            disagreeVisible:false,
            disagreeLoading:false,
            disagreeCause:'',
            modelType:1,
            HandledByOptions:[],//办理人
            ideaType:'办理意见',
            messageForm:{

            },
            FieldPdf:window.localStorage.getItem('FieldPdf'),
            manualKey:null,
            manualVisible:false,
            checkboxKey:[],
            observerRadioKey:'',
            manualformItem:[
                {
                    label: '真实姓名',
                    model: 'realname',
                }
            ],
            manualcolumnsVxe:[
            { 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '真实姓名', //列头显示文字
                field: 'realname',
                fixed: 'left',
            },{
                title: '工作单位', //列头显示文字
                field: 'fgzdw',
            },{
                title: '所属库', //列头显示文字
                field: 'fssk',
            },{
                title: '所属区域', //列头显示文字
                field: 'fssqy',
            },{
                title: '擅长领域',
                field: 'fszly',
            }], 
            manualdataTableConfig:{
                api: assessCheckApi.queryHcyPageList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:300,
                paramet:{},
                isIdeaText:'',
                
            },
            //观察员
            modalObserverKey:null,
            modalObserverConfig:{
                api: assessCheckApi.observerList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:300,
                paramet:{},
                isIdeaText:'',
            },
            modalObservercolumnsVxe:[
            { 
                type: 'radio', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '观察员姓名', //列头显示文字
                field: 'fgcyxm',
                fixed: 'left',
            },{
                title: '单位名称', //列头显示文字
                field: 'fdwmc',
            },{
                title: '所属区域', //列头显示文字
                field: 'fszds',
            }], 
            modalObserverformItem:[
                {
                    label: '观察员姓名',
                    model: 'fgcyxm',
                }
            ],
            //补正流程
            flowJkPageConfig:{
                api:assessCheckApi.spbzlcflowJkPage,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                paramet:{
                    sqsxid:this.flowPathParameter.sqsxid
                }
            },
            flowJkPagecolumnsVxe:[{
                title: '事项名称', //列头显示文字
                field: 'fsxmc',
                fixed: 'left',
            },{
                title: '企业名称', //列头显示文字
                field: 'fqymc',
            },{
                title: '申请单号',
                field: 'fsqdbh',
            },{
                title: '任务编号',
                field: 'fslbh',
            },{
                title: '接收时间',
                field: 'fslsj',
                slots: {
                    // 使用插槽模板渲染
                    default: 'name_fslsj',
                },
            },{
                title: '环节名称',
                field: 'fhjmc',
            },{
                title: '待办人',
                field: 'fdbr',
            },{
                title: '发送人',
                field: 'ffsrmc',
            },{
                title: '发送时间',
                field: 'ffssj',
                slots: {
                    // 使用插槽模板渲染
                    default: 'name_ffssj',
                },
            },{
                title: '操作',
                field: 'id',
                slots: {
                // 使用插槽模板渲染
                default: 'operation_btn',
                },
                width:260,
                fixed:'right'
            }],
            vxeOptionsArr:[],
            addEditParameter:[],
            selectPersonnel:0,
            selectFile:[],
            scrollTop:0,
        }
    },
    computed: {
        editMode(){
            return this.$store.state.permission.editMode
        },
    },
    mounted(){
        this.$nextTick(()=>{
            ocalityPostAction({dictName:'观察员所属地市'}).then(res=>{
                //console.log('字典的res',res)
                if(res.code == 200){
                    if(res.result.length){
                        this.vxeOptionsArr = res.result
                        // this.optionsDataChange(res.result,{label:'itemText',value:'itemValue'})
                        // this.vxeRadioKey = Date.now()
                    }
                    
                }
            })
        })
    },
    created(){
        this.getHandlingOpinionsList('')
    },
    updated(){
        this.$emit('updatedSuccess')
    },
    methods:{
        scrollHader(val){
            //console.log(val.target.scrollTop)
            //滚动条位置
        },
        modevChange(val){
            this.$emit('getModeValue',val)
            //console.log(val)
            this.modevData(val)
            this.$refs.signatureModelRef.getSelectFile([])
        },
        modevData(val){
            if(val === '技术审评' || val == '书面审查意见'){
                    this.dataTableConfig.api = assessCheckApi.querySpHcyXpList
                    this.dataTableConfig.listData = 'spzzXpjlList'

                    this.memberConfig.api = assessCheckApi.querySpHcyXpList
                    this.memberConfig.listData = 'spzyXpjlList'

                    this.producerConfig.api = assessCheckApi.querySpHcyXpList
                    this.producerConfig.listData = 'spfaList'

                    this.inspectorConfig.api = assessCheckApi.querySpHcyXpList
                    this.inspectorConfig.listData = 'hstzList'

                    this.observerConfig.api = assessCheckApi.querySpHcyXpList
                    this.observerConfig.listData = 'spxpxcgcydhList'

                    this.enterpriseConfig.api = assessCheckApi.querySpHcyXpList
                    this.enterpriseConfig.listData = 'qytzsList'
                    this.formField.nextNode = '审评方案审核'
                }else{
                    this.formField.nextNode = '审评方案审核'
                    this.dataTableConfig.api = assessCheckApi.queryHcyXpList
                    this.dataTableConfig.listData = 'zzXpjlList'

                    this.memberConfig.api = assessCheckApi.queryHcyXpList
                    this.memberConfig.listData = 'zyXpjlList'

                    this.producerConfig.api = assessCheckApi.queryHcyXpList
                    this.producerConfig.listData = 'jcfaList'

                    this.inspectorConfig.api = assessCheckApi.queryHcyXpList
                    this.inspectorConfig.listData = 'xpxccydhList'

                    this.observerConfig.api = assessCheckApi.queryHcyXpList
                    this.observerConfig.listData = 'xpxcgcydhList'

                    this.enterpriseConfig.api = assessCheckApi.queryHcyXpList
                    this.enterpriseConfig.listData = 'qydwjctzList'
                }
                this.refreshTable = Date.now()
        },
        selectHandleChange(val){//选择审查模式
            //console.log('0000000000000000',val)
            if(val=='技术审评'){
                this.modeValue = '技术审评'
            }else{
                this.modeValue = '书面审查意见'
            }
            this.$emit('getModeValue',this.modeValue)
            saveSqsxFscmsServe({sqsxid:this.formField.sqsxid,fscms:val}).then(res=>{
                if(res.code == 200){
                    this.$message.success('已选择')
                }else{
                    this.$message.warning(res.message)
                }
            })
        },
        //选择审评时间
        timeArrChange(val,num,text){
            if(num == 1){
                this.formField.spTimeArr[0] = val[0]? moment(val[0]).format('YYYY-MM-DD'):''
                this.formField.spTimeArr[1] = val[1]? moment(val[1]).format('YYYY-MM-DD'):''
                this.formField.fspkssj = val[0]? moment(val[0]).format('YYYY-MM-DD'):''
                this.formField.fspjssj = val[1]? moment(val[1]).format('YYYY-MM-DD'):''
            }else{
                this.formField.timeArr[0] = val[0]? moment(val[0]).format('YYYY-MM-DD'):''
                this.formField.timeArr[1] = val[1]? moment(val[1]).format('YYYY-MM-DD'):''
                this.formField.fcykssj = val[0]? moment(val[0]).format('YYYY-MM-DD'):''
                this.formField.fcyjssj = val[1]? moment(val[1]).format('YYYY-MM-DD'):''
            }
            this.scenePreserveClick(text)
        },
        selectHandleChangeOny(val){
            this.scenePreserveClick(val)
        },
        //验证审评时间
        validateTime(){
            this.form.validateFields((err, values) => {
              if(!err){
              }else{
                return false
              }
            })
        },
        //获取组长、组员、预备审评员
        updatedChange(val){
            //console.log('渲染完成',val)
            // this.manualSuccess()
        },
        automaticClick(list,num){
            //console.log('这不是一个方法')
            var that = this
            list.forEach(item=>{
                if(item.num){
                    let data= {
                        ...item,
                        sqsxid:that.formField.sqsxid,
                        fssqy:num?that.formField.fspxzqy:that.formField.fcyxzqy,
                        hbqy:num?(that.formField.fsphbqy?that.formField.fsphbqy.join(','):that.formField.fsphbqy):(that.formField.fcyhbqy?that.formField.fcyhbqy.join(','):that.formField.fcyhbqy),
                        kssj:num?(moment(that.formField.spTimeArr[0]).format('YYYY-MM-DD')):(moment(that.formField.timeArr[0]).format('YYYY-MM-DD')),
                        jssj:num?(moment(that.formField.spTimeArr[1]).format('YYYY-MM-DD')):(moment(that.formField.timeArr[1]).format('YYYY-MM-DD')),
                        zytc:num?(that.formField.fspzytc?that.formField.fspzytc.join(','):that.formField.fcyzytc):(that.formField.fcyzytc?that.formField.fcyzytc.join(','):that.formField.fcyzytc),
                    }
                    if(this.modeValue == '技术审评'){
                        xpHcyByAutoServe(data).then(res=>{
                            if(res.code == 200){
                                this.numberOfPeopleData.fzzrs = 0
                                this.numberOfPeopleData.fzyrs = 0
                                this.numberOfPeopleData.fybrs = 0
                                this.$message.success('已选择')
                                this.manualSuccess()
                            }else{
                                this.$message.warning(res.message)
                            }
                        })
                    }else{
                        xpZjByAutoInCommon(data).then(res=>{
                            if(res.code == 200){
                                this.numberOfPeopleData.fzzrs = 0
                                this.numberOfPeopleData.fzyrs = 0
                                this.numberOfPeopleData.fybrs = 0
                                this.$message.success('已选择')
                                this.manualSuccess()
                            }else{
                                this.$message.warning(res.message)
                            }
                        })
                    }
                }
            })
        },
        //审查组长 列表同意或不同意
        selectAgree(val,item){
            updateXpHcyxxServe({sqsxid:this.formField.sqsxid,id:item.id,fsftyxp:item.fsftyxp,fbtyyy:item.fbtyyy}).then(res=>{
                        
                if(res.code == 200){
                    this.$message.success('修改成功')
                    this.manualSuccess()
                    this.ideaVisible = false
                }else{
                    this.$message.warning(res.message)
                }
            })
        },
        //发送短息
        sendMessage(val){
            // this.$router.push('/informationConfirmation?id='+val.id)
            var that = this
            this.$confirm({
                title:'您确认要发送短信吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    sendSmsByXpjlQr({id:val.id}).then(res=>{
                        if(res.code == 200){
                            that.$message.success(res.message)
                            that.refreshTable = Date.now()
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },
                
            });
        },
        //审查组长或组员 列表删除
        deleteClick(val){
            var that = this
            this.$confirm({
                title:'您确认要删除吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    deleteXpHcyServe({sqsxid:that.formField.sqsxid,xpjlid:val.id}).then(res=>{
                        if(res.code == 200){
                            that.$message.success('删除成功')
                            that.refreshTable = Date.now()
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },
                
            });
            
        },
        //审查组长或组员手动选
        headmanPicking(val,num){
            this.selectPersonnel = 1
            this.checkboxKey = []
            var that = this
            var formDataR = this.form
            if(num){
                formDataR = this.spForm
            }
            formDataR.validateFields((err, values) => {
                if(!err){
                    that.manualParameter = {
                        fusertype:num?num:'审评员',
                        sqsxid:that.formField.sqsxid,
                        fssk:val,
                        fssqy:num?that.formField.fspxzqy:that.formField.fcyxzqy,
                        hbqy:num?(that.formField.fsphbqy?that.formField.fsphbqy.join(','):that.formField.fsphbqy):(that.formField.fcyhbqy?that.formField.fcyhbqy.join(','):that.formField.fcyhbqy),
                        kssj:num?(moment(that.formField.spTimeArr[0]).format('YYYY-MM-DD')):(moment(that.formField.timeArr[0]).format('YYYY-MM-DD')),
                        jssj:num?(moment(that.formField.spTimeArr[1]).format('YYYY-MM-DD')):(moment(that.formField.timeArr[1]).format('YYYY-MM-DD')),
                        zytc:num?(that.formField.fspzytc?that.formField.fspzytc.join(','):that.formField.fcyzytc):(that.formField.fcyzytc?that.formField.fcyzytc.join(','):that.formField.fcyzytc),
                        type:'选人'
                    }
                    //console.log('选人的数据',that.manualParameter)
                    this.manualdataTableConfig.paramet={
                        ...that.manualParameter
                    }
                    that.manualKey = Date.now()
                    that.manualVisible = true
                }else{
                    this.$message.warning('请输入审评时间')
                }
            })
        },
        checkboxChange(val){
            this.checkboxKey = []
            if(val.length){
                val.forEach(item => {
                    this.checkboxKey.push(item.id)
                });
            }
        },
        //selectObserver
        //选择观察员
        selectObserver(){
            this.observerRadioKey = ''
            this.selectPersonnel = 0
            this.manualVisible = true
            this.modalObserverKey = Date.now()
        },
        //选中观察员
        modalObserverRadioChange(val){
            this.observerRadioKey = val.row.id
        },
        manualHandleOk(){
            if(this.selectPersonnel){
                if(!this.checkboxKey.length){
                    this.$message.warning('请选择人员')
                    return false
                }
                this.confirmLoading = true
                xpHcyByHandServe({hcyids:this.checkboxKey.join(','),
                    fusertype:this.manualParameter.fusertype,
                    jssj:this.manualParameter.jssj,
                    kssj:this.manualParameter.jssj,
                    sqsxid:this.manualParameter.sqsxid}).then(res=>{
                        this.confirmLoading = false
                        if(res.code == 200){
                            // this.$emit('manualSuccess')
                            this.refreshTable = Date.now()
                            this.manualVisible = false
                            
                        }
                    })
            }else{
                if(!this.observerRadioKey){
                    this.$message.success('请选择观察员')
                }else{
                    saveSelectedGcyToSqsx({sqsxid:this.flowPathParameter.sqsxid,id:this.observerRadioKey}).then(res=>{
                        if(res.code == 200){
                            this.refreshTable = Date.now()
                            this.manualVisible = false
                            this.$message.success(res.message)
                            this.generateRecord('选派现场观察员的函')
                        }else{
                            this.$message.warning(res.message)
                        }
                    })
                }
            }
        },
        manualSuccess(){
            this.refreshTable = Date.now()
        },
        //审查组长或组员随机选
        headmanRandom(val,num){
            var that = this
            var formDataR = this.form
            if(num){
                formDataR = this.spForm
            }
            this.headmanRandomNum = num
            this.headmanRandomType = val
            formDataR.validateFields((err, values) => {
                if(!err){
                    if(num == 0){//预备审评员
                        this.numberOfPeopleHandleOk()
                    }else{
                        this.numberOfPeopleVisible = true
                        
                    }
                    
                }else{
                    this.$message.warning('请输入审评时间')
                }
            })
            
            
        },
        numberOfPeopleHandleOk(){
            var that = this
            this.numberOfPeopleVisible = false
            var num = this.headmanRandomNum
            let data= {
                ...this.numberOfPeopleData,
                fusertype:num?num:'审评员',
                sqsxid:that.formField.sqsxid,
                fssk:this.headmanRandomType,
                fssqy:num?that.formField.fspxzqy:that.formField.fcyxzqy,
                hbqy:num?(that.formField.fsphbqy?that.formField.fsphbqy.join(','):that.formField.fsphbqy):(that.formField.fcyhbqy?that.formField.fcyhbqy.join(','):that.formField.fcyhbqy),
                kssj:num?(moment(that.formField.spTimeArr[0]).format('YYYY-MM-DD')):(moment(that.formField.timeArr[0]).format('YYYY-MM-DD')),
                jssj:num?(moment(that.formField.spTimeArr[1]).format('YYYY-MM-DD')):(moment(that.formField.timeArr[1]).format('YYYY-MM-DD')),
                zytc:num?(that.formField.fspzytc?that.formField.fspzytc.join(','):that.formField.fcyzytc):(that.formField.fcyzytc?that.formField.fcyzytc.join(','):that.formField.fcyzytc),
            }
            if(this.headmanRandomNum == 0){
                data.fybrs = 1
            }
            if(this.modeValue == '技术审评'){
                xpHcyByAutoServe(data).then(res=>{
                    if(res.code == 200){
                        this.$message.success('已选择')
                        this.manualSuccess()
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }else{
                xpZjByAutoInCommon(data).then(res=>{
                    if(res.code == 200){
                        this.$message.success('已选择')
                        this.manualSuccess()
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }
            
        },
        //不同意意见
        disagreeClick(val){
            this.disagreeObject = val
            this.disagreeCause = val.fbtyyy
            // this.disagreeVisible = true
            this.opinionsText = val.fbtyyy
            this.isIdeaText = val.fbtyyy
            this.ideaVisible = true
            this.ideaType = '选派不同意意见'
            this.getHandlingOpinionsList(this.opinionsText,this.ideaType)
        },
        //获取方案企业基本信息等
        getBasicField(title,key){
            queryYwzdYwflContent({fzdlx1:title}).then(res=>{
                if(res.code == 200){
                    this.formField[key] = res.result.content?res.result.content:''
                    this.$message.success(res.message)
                }else{
                    this.$message.warning(res.message)
                }
            })
        },
        //manualHandleOk
        //补正退回
        expertProcessReturn(val){
            //console.log(val)
            var that = this
            this.$confirm({
                title:'您确认要退回吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    returnSpBzFlow({jobid:val.jobid}).then(res=>{
                        if(res.code == 200){
                            that.$message.success(res.message)
                            that.manualSuccess()
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },
                
            });
        },
        //生成记录
        generateRecord(val){
            if(val == '发起流程'){
                initBzFlow({sqsxid:this.formField.sqsxid}).then(res=>{
                    if(res.code == 200){
                        this.manualSuccess()
                        this.$message.success('已发起流程')
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }else{
                initWjjlServe({sqsxid:this.formField.sqsxid,type:val}).then(res=>{
                    if(res.code == 200){
                        this.manualSuccess()
                        this.$message.success(res.message)
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }
            
        },
        producerMould(row,val){
            this.$refs.selectTemplateRef.getSelectTemplate(row,val,this.formField.sqsxid)
            this.$refs.selectTemplateRef.selectTemplateVisible = true
        },
        selectTemplateComplete(){
            this.manualSuccess()
        },
        selectTemplateChange(val){
            this.templateId = val.row.id
        },
        
        //方案删除
        producerDelete(val){
            var that = this
            this.$confirm({
                title:'您确认要删除吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    deletemodelByIdServe({id:val.id}).then(res=>{
                        if(res.code == 200){
                            that.manualSuccess()
                            that.$message.success('删除成功')
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },
                
            });
            
        },
        //方案上传
        producerBeforeUpload(e){
            return false
        },
        producerUpload({file},val){//
            var that = this
            if(typeof file.uid !== 'undefined') {
                // if(file.name.indexOf(".xls") !== -1 || file.name.indexOf(".xlsx") !==-1) {
                    const fileData = new FormData();
                    fileData.append("file",file);
                    fileData.append("fywflcode",blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]);
                    fileData.append("id",val.id);
                    fileData.append("sqsxid",this.formField.sqsxid);
                    
                    uploadPdfFileById(fileData).then(res => {
                        if(res.code !== 200){
                            that.$message.warning('请上传pdf文件或者联系管理员!')
                        }else{
                            this.manualSuccess()
                            that.$message.success('上传成功')
                        }
                        
                    })
                // }
                
            }
        },
        viewClick(val){
            this.$refs.serverEditingViewRef.getData({id:val.id,fwjlx:val.fwjlx})
            this.$refs.serverEditingViewRef.serverEditingVisible = true
        },
        //查看
        lookOverClick(val){
            getFileTypeServe({id:val.id}).then(res=>{
                if(res.code == 200){
                    if(res.result == '.pdf'){
                        window.open(
                            bootConfig[process.env.NODE_ENV].locality_ApI+YchConstant.SPZX_SPCY+'/spcySqsxWjjl/getCrossLocalFile?id='+val.id
                        )
                    }else{
                        this.$message.warning('只能查看pdf文件')
                    }
                    
                }
                
            })
            
        },
        //方案下载
        producerDownload(val){//下载模板
            var that = this
            var fileName = val.fwjccmc 
            let param = { fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],id:val.id,sqsxid:this.formField.sqsxid}
            
            getFileTypeServe({id:val.id}).then(res=>{
                if(res.code == 200){
                    getLocalFileByIdServe(param).then((data) => {
                        if (!data) {
                            that.$message.warning('文件下载失败')
                        return
                        }
                        // if (typeof window.navigator.msSaveBlob !== 'undefined') {
                        //     window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }))
                        // } else {
                            let url = window.URL.createObjectURL(new Blob([data], { type: blobType.type[blobType.suffix.indexOf(val.fwjlx)] }))
                            let link = document.createElement('a')
                            link.style.display = 'none'
                            link.href = url
                            link.setAttribute('download', fileName + res.result)
                            document.body.appendChild(link)
                            link.click()
                            document.body.removeChild(link) //下载完成移除元素
                            window.URL.revokeObjectURL(url) //释放掉blob对象
                        // }
                    })
                }
                
            })
           
            
        },
        //方案发送
        producerTransmit(val){
            sendSmsToFileServe({id:val.id,sqsxid:this.formField.sqsxid}).then(res=>{
                if(res.code == 200){
                    this.$message.success('已发送')
                }else{
                    this.$message.warning(res.message)
                }
            })
        },
         //重新编辑
         againEdit(val){
            var that = this
            this.$confirm({
                title:'您确认删除已生成的pdf重新编辑文档吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    againEditPdfFile({id:val.id}).then(res=>{
                        if(res.code == 200){
                            that.$webOffice(
                                `api/spzx-spcy/spcyRsWjmb/openWjjl?id=${res.result.id}`,
                                `api/spzx-spcy/spcyRsWjmb/onLineSaveWjjl?id=${res.result.id}`+`-name=${val.fwjlx1+val.fwjlx}`,
                                `api/spzx-spcy/spcyRsWjmb/saveFileToPdf2?id=${res.result.id}`+`&sqsxid=${that.formField.sqsxid}`,
                                `api/spzx-spcy/spcyRsWjmb/saveFileGzToPdf2?id=${res.result.id}`+`&sqsxid=${that.formField.sqsxid}`,
                                `api/spzx-spcy/spcyRsWjmb/againEditOutPdfFile?id=${res.result.id}`,
                            )
                            that.refreshTable = Date.now()
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },
                
            });
        },
        //服务端编辑
        serverEdit(val){
            this.$refs.serverEditingRef.getData(val)
        },
        //在线编辑
        producerEdit(val){
            var that = this
            //console.log('在线编辑',val)
            if(val.fwjlx == '.pdf'){
                this.$message.warning('pdf文件无法编辑')
            }else{
                // window.localStorage.setItem('FieldPdf','0')
                // this.modelType = 2
                getFileTypeServe({id:val.id}).then(res=>{
                    if(res.code == 200){
                        if(res.result !== '.pdf'){
                                that.$webOffice(`api/spzx-spcy/spcyRsWjmb/openWjjl?id=${val.id}`,
                            `api/spzx-spcy/spcyRsWjmb/onLineSaveWjjl?id=${val.id}`+`-name=${val.fwjlx1+val.fwjlx}`,
                                `api/spzx-spcy/spcyRsWjmb/saveFileToPdf2?id=${val.id}`+`&sqsxid=${this.formField.sqsxid}`,
                                `api/spzx-spcy/spcyRsWjmb/saveFileGzToPdf2?id=${val.id}`+`&sqsxid=${this.formField.sqsxid}`,
                                `api/spzx-spcy/spcyRsWjmb/againEditOutPdfFile?id=${val.id}`,
                            )
                        }else{
                            this.refreshTable = Date.now()
                            this.$message.warning('pdf文件无法编辑')
                        }
                        
                    }
                    
                })
                
            }
            
        },
        //查看企业
        viewEnterprise(val){
            queryQyxxById({id:val.fbusid}).then(res=>{
                if(res.code == 200){
                    let data = res.result
                    this.addEditParameter = {
                        id:data.id,
                        fqyfddbrfzr:data.fqyfddbrfzr,
                        fqylxr:data.fqylxr,
                        fqylxrdh:data.fqylxrdh,
                        fqylxryx:data.fqylxryx,
                        fqymc:data.fqymc,
                        fqyxkzh:data.fqyxkzh,
                        fqyxkzyxq:data.fqyxkzyxq,
                        fqyzszcdz:data.fqyzszcdz,
                        fszdq:data.fszdq,
                        ftyshxydm:data.ftyshxydm,
                        fxxdz:data.fxxdz,
                        fxzjg:data.fxzjg
                    }
                    this.$refs.refModel.visibleShow = true
                }else{
                    this.$message.warning(res.message)
                }
            })

        },
        //编辑审评员
        editInspector(val,numm){
            //console.log(val)
            if(numm){//编辑企业
                this.modelType = 3
                queryQyxxById({id:val.fbusid}).then(res=>{
                    if(res.code == 200){
                        this.messageForm = {
                            id:val.fbusid,
                            idb:res.result.id,
                            fphone:res.result.fqylxrdh,
                            femail:res.result.fqylxryx,
                        }
                        this.disagreeVisible = true
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }else{
                this.modelType = 2
            
                if(val.fbusid){
                    commonQueryHcyByXpIdServe({fbusid:val.fbusid,sqsxid:this.formField.sqsxid}).then(res=>{
                        if(res.code == 200){
                            this.messageForm = {
                                id:val.fbusid,
                                idb:res.result.id,
                                fphone:res.result.phone,
                                femail:res.result.email,
                            }
                            this.disagreeVisible = true
                        }else{
                            this.$message.warning(res.message)
                        }
                    })
                }else{
                    this.messageForm = {
                        id:val.id,
                        idb:val.fuserid,
                        fphone:val.fjcylxdh,
                        femail:val.fjcyyx,
                    }
                    this.disagreeVisible = true
                }
            }
            

        },
        //编辑观察员
        editObserver(val,num){
            this.modelType = 1
            spcyRsGcyQueryByIdServe({id:val.fbusid}).then(res=>{
                if(res.code == 200){
                    //console.log(res)
                    this.messageForm = {
                        id:val.fbusid,
                        idb:res.result.id,
                        fphone:res.result.fphone,
                        femail:res.result.femail,
                    }
                    this.disagreeVisible = true
                }
            })
            
        },
        //提交观察员和审评员信息
        disagreeHandleOk(){
            this.disagreeLoading = true
            if(this.modelType == 1 ){
                spcyRsGcyEditServe({id:this.messageForm.idb,email:this.messageForm.femail,phone:this.messageForm.fphone,sqsxid:this.formField.sqsxid}).then(res=>{
                    if(res.code == 200){
                        this.disagreeVisible = false
                        this.refreshTable = Date.now()
                        this.$message.success('修改成功')
                    }else{
                        this.$message.warning(res.message)
                    }
                    this.disagreeLoading = false
                })
            }else if(this.modelType == 2){
                commonUpdateHcyJbxxServe({id:this.messageForm.idb,email:this.messageForm.femail,phone:this.messageForm.fphone,sqsxid:this.formField.sqsxid}).then(res=>{
                    if(res.code == 200){
                        this.disagreeVisible = false
                        this.refreshTable = Date.now()
                        this.$message.success('修改成功')
                    }else{
                        this.$message.warning(res.message)
                    }
                    this.disagreeLoading = false
                })
            }else if(this.modelType == 3){
                editQyxx({id:this.messageForm.id,fqylxrdh:this.messageForm.fphone,fqylxryx:this.messageForm.femail}).then(res=>{
                    if(res.code == 200){
                        this.disagreeVisible = false
                        this.refreshTable = Date.now()
                        this.$message.success('修改成功')
                    }else{
                        this.$message.warning(res.message)
                    }
                    this.disagreeLoading = false
                })
            }
            
            
        },

        ideaClick(val){
            //console.log('当前的val',val)
            // if(val == '技术审评'){
            //     // this.opinionsText = this.formField.spOpinion
            //     this.getHandlingOpinionsList(this.opinionsText,this.ideaType)
            // }else{
            //     // this.opinionsText = this.formField.opinion
                
            // }
            this.getHandlingOpinionsList(this.opinionsText,this.ideaType)
            this.ideaVisible = true
            this.ideaType = '办理意见'
            
            this.$nextTick(()=>{
                this.ideaBlur()
            })
        },
        ideaBlur(){

        },
        ideaFocusEvent(){
            this.$nextTick(()=>{
                this.ideaBlur()
            })
        },
        getHandlingOpinionsList(val,ideaType){//查询办理意见
            //console.log('查询办理意见',val,ideaType)
            handlingOpinionsListServe({ftype1:ideaType,pageNo:1,pageSize:1000,fcontent:val}).then(res=>{
                if(res.code == 200){
                    this.opinionsList = res.result.records
                }
            })
        },
        recordCommentsChange(){
            //console.log('recordCommentsChange',this.opinionsText)
            if(this.opinionsText){
                this.getHandlingOpinionsList(this.opinionsText,this.ideaType)
            }
            
            if(this.opinionsText){
                this.isRecordComments = true
            }else{
                this.isRecordComments = false
            }
        },
        selectIdea(val){//选择办理意见
            // if(this.ideaType === '办理意见'){
                this.opinionsText = val.fcontent
                //console.log('选择办理意见',val.fcontent)
                this.getHandlingOpinionsList(val.fcontent,this.ideaType)
                //console.log('val.fcontent')
            // }
            
            this.isRecordComments = false

        },
        recordCommentsFocus(){
            this.isRecordComments = true
        },
        recordCommentsBlur(){},
        deleteIdea(val){//删除办理意见
            deleteBatchIdeaServe({ids:val.id}).then(res=>{
                if(res.code == 200){
                    this.getHandlingOpinionsList(this.opinionsText,this.ideaType)
                }else{
                    this.$message.warning(res.message)
                }
            })
        },
        ideaHandleOk(){
            this.ideaVisible = false
            if(this.ideaType == '选派不同意意见'){
                updateXpHcyxxServe({sqsxid:this.formField.sqsxid,id:this.disagreeObject.id,fsftyxp:this.disagreeObject.fsftyxp,fbtyyy:this.opinionsText}).then(res=>{
                    if(res.code == 200){
                        this.$message.success(res.message)
                        this.manualSuccess()
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }
                
                if(this.ideaType == '办理意见'){
                    //console.log('555',this.modeValue)
                    //console.log(this.opinionsText)
                    
                    if(this.modeValue == '技术审评'){
                        this.formField.opinion = this.opinionsText
                        this.transactForm.setFieldsValue({
                            opinion:this.opinionsText,
                        });
                    }else if(this.modeValue == '书面审查意见'){
                        this.formField.spOpinion = this.opinionsText
                        this.spTransactForm.setFieldsValue({
                            spOpinion:this.opinionsText,
                        });
                    }
                    //console.log(this.formField.opinion)
                    
                }
            
            
        },
        saveComments(){
            this.ideaHandleOk()
            if(this.opinionsText ){
                // (this.modeValue == '技术审评' &&this.opinionsText !== this.formField.opinion) || (this.modeValue == '技术审评' && this.opinionsText !== this.formField.spOpinion) || this.opinionsText !==this.isIdeaText
                // if (this.ideaType == '办理意见') {
                    addBatchIdeaServe({ftype1:this.ideaType,fcontent:this.opinionsText}).then(res=>{
                        // if(res.code == 200){
                        //     this.$message.success(res.message)
                        // }else{
                        //     this.$message.warning(res.message)
                        // }
                        this.getHandlingOpinionsList(this.opinionsText,this.ideaType)
                    })
                // }
            }
        },
        //现场保存和提交
        scenePreserveClick(val,isTip){
            //console.log('保存',val)
            var that = this
            if(val == '技术审评'){
                // this.form.validateFields((err, values) => {
                    // //console.log(err)
                    // if(!err){
                        let data = {
                            jobid:that.formField.jobid,
                            sqsxid:that.formField.sqsxid, 
                            // dbrid:values.dbrid.join(','),
                            opinion:that.formField.opinion,
                            smgflag:that.formField.smgflag?'是':'否',
                            fscms:'技术审评',
                            map:{
                                fcykssj:that.formField.timeArr[0],
                                fcyjssj:that.formField.timeArr[1],
                                fcyhbqy:that.formField.fcyhbqy?that.formField.fcyhbqy.join(','):'',
                                fcyxzqy:that.formField.fcyxzqy?that.formField.fcyxzqy:'',
                                fcyzytc:that.formField.fcyzytc?that.formField.fcyzytc.join(','):'',
                                fcyjcfw:that.formField.fcyjcfw?that.formField.fcyjcfw:'',
                                fcyjcyj:that.formField.fcyjcyj?that.formField.fcyjcyj:'',
                                
                            }

                        }
                        addServe(data).then(res=>{
                            if(res.code == 200){
                                that.$emit('flowPathTwoSuccess',1)
                                if(!isTip){
                                    that.$message.success('保存成功')
                                }
                                
                            }else{
                                that.$message.warning(res.message)
                            }
                        })
                    // }else{
                    //     this.$message.warning('请选择审评时间')
                    // }
                // })
            }else if(val == '技术审评'){
                // this.spForm.validateFields((err, values) => {
                //     if(!err){
                        let data = {
                            jobid:that.formField.jobid,
                            sqsxid:that.formField.sqsxid,
                            // dbrid:values.dbrid.join(','),
                            opinion:that.formField.spOpinion,
                            smgflag:that.formField.spSmgflag?'是':'否',
                            fscms:'技术审评',
                            map:{
                                fspkssj:that.formField.spTimeArr[0],
                                fspjssj:that.formField.spTimeArr[1],
                                fsphbqy:that.formField.fsphbqy?that.formField.fsphbqy.join(','):'',
                                fspxzqy:that.formField.fspxzqy?that.formField.fspxzqy:'',
                                fspzytc:that.formField.fspzytc?that.formField.fspzytc.join(','):'',
                            }

                        }
                        addServe(data).then(res=>{
                            if(res.code == 200){
                                that.$emit('flowPathTwoSuccess',1)
                                that.$message.success('保存成功')
                            }else{
                                that.$message.warning(res.message)
                            }
                        })
                //     }else{
                //         this.$message.warning('请选择审评时间')
                //     }
                // })
            }
            
        },
        //退回
        forwardClick(){
            var that = this
            this.$confirm({
                title:'您确认要退回吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    that.fthyjForm.validateFields((err, values) => {
                        if(!err){
                            returnUpperXcjcFlowJob({
                                    jobid:that.formField.jobid,
                                    shjid:that.formField.shjid,
                                    opinion:values.fthyjInput,
                                }).then(res=>{
                                if(res.code == 200){
                                    that.$emit('flowPathTwoSuccess')
                                    that.$message.success(res.message)
                                }else{
                                    that.$message.warning(res.message)
                                }
                            })
                        }
                    })
                },
                
            });
        },
        flowPathTwoSuccess(val){
            this.$emit('flowPathTwoSuccess',val)
        },
        //提交综合评定
        comprehensiveEvaluation(val){
            var that = this
            that.transactForm.validateFields((err2, values2) => {
                if(values2.opinion){
                    let data = {}
                    data = {
                        ...data,
                        jobid:that.formField.jobid,
                        sqsxid:that.formField.sqsxid,
                        opinion:values2.opinion,
                        smgflag:that.formField.smgflag?'是':'否',
                        fscms:val,
                        nextNode:'综合评定',
                        map:{
                            fcykssj:that.formField.timeArr[0],
                            fcyjssj:that.formField.timeArr[1],
                            fcyhbqy:that.formField.fcyhbqy?that.formField.fcyhbqy.join(','):'',
                            fcyxzqy:that.formField.fcyxzqy?that.formField.fcyxzqy:'',
                            fcyzytc:that.formField.fcyzytc?that.formField.fcyzytc.join(','):'',
                            fcyjcfw:that.formField.fcyjcfw?that.formField.fcyjcfw:'',
                            fcyjcyj:that.formField.fcyjcyj?that.formField.fcyjcyj:'',
                            
                        }

                    }
                    editServe(data).then(res=>{
                        if(res.code == 200){
                            that.$emit('flowPathTwoSuccess')
                            that.$message.success('提交成功')
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                }
            })
        },

        sceneSubmitClick(val){
            let canHandle = false
            //console.log('提交',val)
            var that = this
            if(val == '技术审评'){
                this.form.validateFields((err, values) => {
                    if(!err){
                        // that.transactForm.validateFields((err2, values2) => {
                        //     if(!err2){
                        //         let data = {}
                        //         data = {
                        //             ...data,
                        //             jobid:that.formField.jobid,
                        //             sqsxid:that.formField.sqsxid,
                        //             opinion:values2.opinion,
                        //             dbrid:values2.dbrid.join(','),
                        //             smgflag:that.formField.smgflag?'是':'否',
                        //             fscms:'技术审评',
                        //             map:{
                        //                 fcykssj:values.timeArr[0],
                        //                 fcyjssj:values.timeArr[1],
                        //                 fcyhbqy:that.formField.fcyhbqy?that.formField.fcyhbqy.join(','):'',
                        //                 fcyxzqy:that.formField.fcyxzqy?that.formField.fcyxzqy:'',
                        //                 fcyzytc:that.formField.fcyzytc?that.formField.fcyzytc.join(','):'',
                        //                 fcyjcfw:that.formField.fcyjcfw?that.formField.fcyjcfw:'',
                        //                 fcyjcyj:that.formField.fcyjcyj?that.formField.fcyjcyj:'',

                        //             }

                        //         }
                        //         editServe(data).then(res=>{
                        //             if(res.code == 200){
                        //                 that.$emit('flowPathTwoSuccess')
                        //                 that.$message.success('提交成功')
                        //             }else{
                        //                 that.$message.warning(res.message)
                        //             }
                        //         })
                        //     }
                        // })
                        that.scenePreserveClick('技术审评',true)
                        canHandle = true
                    }else{
                        for(let key in err){
                            that.$message.warning(err[key].errors[0].message)
                            return false
                        }
                        
                    }
                    
                })
                return canHandle
            }else if(val == '技术审评'){
                this.spForm.validateFields((err, values) => {
                    if(!err){
                        
                        that.spTransactForm.validateFields((err, values2) => {
                            if(!err){
                                let data = {
                                    jobid:that.formField.jobid,
                                    sqsxid:that.formField.sqsxid,
                                    dbrid:values2.spDbrid.join(','),
                                    opinion:values2.spOpinion,
                                    smgflag:that.formField.spSmgflag?'是':'否',
                                    fscms:'技术审评',
                                    map:{
                                        fspkssj:values.spTimeArr[0],
                                        fspjssj:values.spTimeArr[1],
                                        fsphbqy:that.formField.fsphbqy?that.formField.fsphbqy.join(','):'',
                                        fspxzqy:that.formField.fspxzqy,
                                        fspzytc:that.formField.fspzytc?that.formField.fspzytc.join(','):'',
                                    }

                                }
                                editServe(data).then(res=>{
                                    if(res.code == 200){
                                        that.$emit('flowPathTwoSuccess')
                                        that.$message.success('提交成功')
                                    }else{
                                        that.$message.warning(res.message)
                                    }
                                })
                            }
                        })
                    }else{
                        this.$message.warning('请选择审评时间')
                    }
                    
                })
            }
            
        },
        timeProcessing(val){
            if(val){
                val = val.slice(0,11)
            }
            return val
        },
        programmeCheckboxChange(row){//选中方案
            if(this.selectFile.indexOf(row[0].id) == -1){
                this.selectFile.push(row[0].id)
            }else{
                this.selectFile.splice(this.selectFile.indexOf(row[0].id),1)
            }

        },
        signatureClick(){//签章
            if(this.modeValue == '技术审评'){
                this.$refs.technicalReviewRef.signatureClick()
            }else{
                this.$store.commit("SET_GXCADATA_NULL", [])
                if(this.selectFile.length){
                    this.$refs.signatureModelRef.signatureVisible = true
                    this.$refs.signatureModelRef.getSelectFile(this.selectFile)
                }else{
                    this.$message.warning('请选择需要签章文件')
                }
            }
            
            
        },
    }
}
</script>
<style lang="less">
.medicalEquipment-planProduction-box{
    height: calc(100vh - 142px);
    overflow-y: auto;
    background: #fff;
}
//意见记录
.opinion-record-box{
    width: 447px;
    display: flex;
    overflow-y: auto;
    border: 1px solid rgb(233 228 228);
    box-shadow: -1px 25px 20px rgb(233 228 228);
    .content-box{
        width: 100%;
        height: 320px;
        .content-for{
            border-bottom: 1px solid rgb(233 228 228);
            display: flex;
            flex: 1;
            width: 100%;
            .content-item{
                width: 100%;
                padding: 10px 20px;
                display: flex;
                justify-content: space-between;
                align-items: center;
                .content-text{
                    
                }
            }
        }
    }
    .no-data-box{
        width: 100%;
        display: flex;
        padding-right: 20px;
        text-align: center;
        justify-content: center;
        height: 100px;
        line-height: 80px;
    }
    
}
.head-form-box{
    display: flex;
    flex-direction: column !important;
    .ant-form-item-label{
        min-width: 82px !important;
    }
}
.tabs-collapse-box{
    // .ant-collapse-item{
    //     margin-bottom: 25px;
    // }
}
.vxe-table-box-w{
    .ant-form-item-control-wrapper{
        width: 65px !important;
    }
}
.form-item-len{
    .ant-form-item-control-wrapper{
        width: 300px !important;
    }
}
.comments-or-reasons-box{
    .ant-form-item-control-wrapper{
        width: 380px !important;
    }
}
.ant-upload-list{
    display: none !important;
 }
 .label-box-w{
    .ant-form-item-label{
        width: 142px;
    }
    .segment-long-box{
    width: 100%;
    .ant-form-item-control-wrapper{
        width: 80%;
    }
    .ant-form-item-children{
        display: flex;
    }
}
}
.red-btn{
    border: 1px solid #ed5565 !important;
    background-color: #ed5565 !important;
}
</style>
<style scoped>
.ant-back-top {
  bottom: 100px;
  position: fixed;
    right: 30px;
    z-index: 99;
}
.ant-back-top-inner {
  height: 40px;
  width: 40px;
  line-height: 40px;
  border-radius: 4px;
  background-color: #1088e9;
  color: #fff;
  text-align: center;
  font-size: 20px;
}
</style>